<!-- 查询 content -->
{{ $contentSQL := "* FROM content WHERE id=? and status<3 order by status desc, sortNo desc" }}

{{ if eq .userType 1}}
  {{ $contentSQL ="* FROM content WHERE id=? order by sortNo desc" }}
{{end}}

{{ $content := selectOne "content" $contentSQL .UrlPathParam }}

{{ $prevContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo < ? order by sortNo desc " $content.SortNo  }}
{{ $nextContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo > ? order by sortNo asc " $content.SortNo  }}

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <title>{{ $content.Title }}</title>
  <meta name="description" content="{{ $content.Description }}" />
  <meta name="keyword" content="{{ $content.Keyword }}" />

{{template "bodystart.html"  }}

		
<main id="main" class="site-main">
<article class="{{ $content.Id }} post type-post status-publish format-standard hentry category-uncategorized ast-article-single" id="{{ $content.Id }}" itemtype="https://schema.org/CreativeWork" itemscope="itemscope">
	
<div class="ast-post-format- ast-no-thumb single-layout-1">
	
		<header class="entry-header ">
			<h1 class="entry-title" itemprop="headline">{{ $content.Title }}</h1>
			<div class="entry-meta">栏目：<span class="posted-by vcard author" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author">			
				<a title="查看{{ $content.CategoryName }}栏目的所有文章"
				href="{{basePath}}{{ trimSlash $content.CategoryID }}" rel="author" class="url fn n" itemprop="url">
				<span class="author-name" itemprop="name">{{ $content.CategoryName }}</span>
			</a>
		</span>

		 / <span class="posted-on"><span class="published" itemprop="datePublished"> {{ $content.CreateTime }} </span></span></div>
			
		</header><!-- .entry-header -->

	
	
	<div class="entry-content clear" itemprop="text">

		
		{{ safeHTML $content.Content }}

		
		
	</div><!-- .entry-content .clear -->
</div>

	
</article><!-- #post-## -->


	        <nav class="navigation post-navigation" role="navigation" aria-label="Post navigation">

	                <span class="screen-reader-text">Post navigation</span>
	                <div class="nav-links">
						
						
						{{if $prevContent.Id }}
						<div class="nav-previous"><a title="{{$prevContent.Title}}" href="{{basePath}}{{ trimPrefixSlash $prevContent.Id}}" rel="prev"><span class="ast-post-nav"><span class="ahfb-svg-iconset ast-inline-flex svg-baseline"><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M134.059 296H436c6.627 0 12-5.373 12-12v-56c0-6.627-5.373-12-12-12H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.569 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296z'></path></svg></span> {{$prevContent.Title}}</span></a></div>
						{{end}}
						{{if $nextContent.Id }}
						<div class="nav-next"><a title="{{$nextContent.Title}}" href="{{basePath}}{{ trimPrefixSlash $nextContent.Id}}" rel="next"><span class="ast-post-nav">{{$nextContent.Title}} <span class="ahfb-svg-iconset ast-inline-flex svg-baseline"><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z'></path></svg></span></span> </a></div></div>
	                    {{end}}
			
				</nav>			
		
		</main><!-- #main -->
			
		
{{template "bodyend.html" }}